--2 de 3
--unos códigos que hice por ocio... ahi están para quien le interese
--usar como fondo de bganimation
--(Screen[name] Background/default.lua)
local t = Def.ActorFrame {
	--InitCommand=cmd(zbuffer,true)
}

local OldxStart
local cont = false

for i=0,100 do
t[#t+1] = LoadActor("_bright")..{
	InitCommand=cmd(playcommand,"Loop");
	LoopCommand=function(self)
		local xStart = math.random(0,SCREEN_WIDTH)
		local fSec = clamp( math.random(), .5, 2) * 2
		--para evitar repetir randoms
		while cont do
			if OldxStart == xStart or OldfSec == fSec then
				xStart = math.random(0,SCREEN_WIDTH)
				fSec = clamp( math.random(), .5, 2) * 2
				cont = false
			else
				cont = true
			end
		end
		
		self:x(xStart);
		self:y(-30);
		self:diffuse(color("#0000FF"));
		self:diffusealpha(1);
		
		self:accelerate(fSec);
		self:y(SCREEN_BOTTOM+30);
		self:diffuse(color("#00FFFF"));
		self:diffusealpha(0);
		
		OldxStart = xStart
		OldfSec = fSec
		
		self:sleep(0.1);
		self:queuecommand("Loop");
	end;
}
end

return t